ROS(MikroTik RouterOS)自动设置校准/同步系统时间

您所在的位置:网站首页 mikrotik routeros软路由配置 ROS(MikroTik RouterOS)自动设置校准/同步系统时间

ROS(MikroTik RouterOS)自动设置校准/同步系统时间

2023-09-07 18:45| 来源: 网络整理| 查看: 265

介NTP 是网络时间协议(Network Time Protocol),它用来同步网络设备【如计算机、手机】的时间的协议。为我们提供准确时间。因为我们的手表、手机、电脑等设备,经常会跑着跑着时间就出现了误差,或快或慢的少几秒,时间长了甚至误差过分钟。对于ROS来讲当你的ROS服务器主板电池没电或断电时间错误时,可能会比较需要这个脚本,用来从网络上校准系统时间。操作菜单:system- ntp client

新版v7.x配置相对简单很多,直接填入域名即可

v6.x:sntpclient

v6.x脚本:

/system clock set time-zone-name=Asia/Shanghai :global ntpipnewp ([:resolve ntp.aliyun.com]) /system ntp client set primary-ntp=$ntpipnewp :global ntpipnews ([:resolve time1.cloud.tencent.com]) /system ntp client set secondary-ntp=$ntpipnews

*阿里云的NTP服务器:

ntp1.aliyun.com ntp2.aliyun.com ntp3.aliyun.com ntp4.aliyun.com ntp5.aliyun.com ntp6.aliyun.com ntp7.aliyun.com

*腾讯云的NTP服务器:

time1.cloud.tencent.com time2.cloud.tencent.com time3.cloud.tencent.com time4.cloud.tencent.com time5.cloud.tencent.com

每月通过域名更新一次ntp server。v6.x用v7.x不需要

/sys scheduler remove ntp-server-update /system scheduler add interval=4w2d name=ntp-server-update on-event="/system clock set time-zone-name=Asia/Shanghai\r\ \n/system ntp client set enabled=yes primary-ntp=120.25.115.20 secondary-ntp=203.107.6.88\r\ \n:global ntpipnewp ([:resolve ntp.aliyun.com]) \r\ \n/system ntp client set primary-ntp=\$ntpipnewp\r\ \n:global ntpipnews ([:resolve time1.cloud.tencent.com]) \r\ \n/system ntp client set secondary-ntp=\$ntpipnews\r\ \n" start-date=jan/01/1990 \ start-time=03:00:00

>相关内容:

脚本-MikroTik RouterOS/ROS每天周期自动备份/加计划任务执行备份 脚本-MikroTik RouterOS/ROS自动定时重启,隔几天在几点重启 脚本-MikroTik Routeros/ros自动删除close连接,提升系统资源,优化 RouterOS创建PPTP服务器 ROS统计在线用户数脚本


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3